# -*- coding: utf-8 -*-
from odoo import models, api, fields, tools
from odoo.exceptions import UserError
import re


class project_temp_fund(models.Model):

    _name = "proman.project_temp_fund"
    _description = "资金模板"
    _table = "proman_project_temp_fund"
    _order = "sequence"

    sequence = fields.Integer(string="排序",translate = 0)
    name = fields.Char(string="名称",help = '请输入名称',translate = 0)
    company_id = fields.Many2one(string="所属公司",comodel_name = 'res.company',default = lambda self:self.env.company,required = 1,translate = 0)
    main_id = fields.Many2one(string="主单据号",comodel_name = 'proman.project_temp',ondelete = 'cascade',translate = 0)
    fund_id = fields.Many2one(string="资金来源",help = '请输入资金来源',comodel_name = 'proman.fund_category',translate = 0)
    currency_id = fields.Many2one(string="货币",comodel_name = 'res.currency',default = lambda self:self.env['res.currency'].search([('name','=','CNY')]),translate = 0)
    exchange_rate = fields.Float(string="汇率",translate = 0)
    uom_id = fields.Many2one(string="计量单位",comodel_name = 'uom.uom',translate = 0)
    parent_category_id = fields.Many2one(string="上级类别",comodel_name = 'proman.fund_category',translate = 0)
